package com.manpower.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * MpRole entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "mp_role", catalog = "manpower")
public class MpRole implements java.io.Serializable {

	// Fields

	private String id;
	private String roleName;
	private Set<MpUserRole> mpUserRoles = new HashSet<MpUserRole>(0);
	private Set<MpRolePopedom> mpRolePopedoms = new HashSet<MpRolePopedom>(0);

	// Constructors

	/** default constructor */
	public MpRole() {
	}

	/** minimal constructor */
	public MpRole(String id) {
		this.id = id;
	}

	/** full constructor */
	public MpRole(String id, String roleName, Set<MpUserRole> mpUserRoles,
			Set<MpRolePopedom> mpRolePopedoms) {
		this.id = id;
		this.roleName = roleName;
		this.mpUserRoles = mpUserRoles;
		this.mpRolePopedoms = mpRolePopedoms;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "role_name", length = 200)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpRole")
	public Set<MpUserRole> getMpUserRoles() {
		return this.mpUserRoles;
	}

	public void setMpUserRoles(Set<MpUserRole> mpUserRoles) {
		this.mpUserRoles = mpUserRoles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mpRole")
	public Set<MpRolePopedom> getMpRolePopedoms() {
		return this.mpRolePopedoms;
	}

	public void setMpRolePopedoms(Set<MpRolePopedom> mpRolePopedoms) {
		this.mpRolePopedoms = mpRolePopedoms;
	}

}